﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Nntp
{
    using System.IO;

    /// <summary>Represents a LAST command to be sent to an NNTP server, see
    /// <a href="http://www.ietf.org/rfc/rfc3977.txt">RFC 3977</a> 6.1.3.</summary>
    /// <threadsafety static="true" instance="false"/>
    public sealed class LastCommand : SingleLineCommand<LastResponse, long, string>
    {
        private static readonly string[] SuccessResponseCodes = { "223" };

        /// <summary>Initializes a new instance of the <see cref="LastCommand"/> class.</summary>
        public LastCommand() : base("LAST", SuccessResponseCodes)
        {
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>See <see cref="SingleLineCommandBase{T, U, V, W}.CreateResponse(V, W, Stream)"/>.</summary>
        protected sealed override LastResponse CreateResponse(long p1, string p2, Stream subsequentLines)
        {
            return new LastResponse(p1, p2);
        }
    }
}
